<template>
  <div>
    <Nav :title="title" :path="path"></Nav>
    <div class="content">
      <Content :item="lists"></Content>
    </div>
  </div>
</template>

<script>
import Content from "../../components/Content";
import transfromStar from "../../utils/index"
export default {
  data() {
    return {
      lists: [],
      title:"",
      path:'/tabbar/movie'
    };
  },
  components: {
    Content,
  },
  mounted() {
    var { keyword, title } = this.$route.query;
    this.title = title
    this.$http.get(`/movie?m=${keyword}`).then((res) => {
      var arr = res.data.result;
      arr.forEach(item=>{
        item.star=transfromStar(item.rating)
      })
      this.lists=arr;
    });
  },
};
</script>

<style  scoped>
.content{
  margin-top: 90px;
}
</style>